import { objDeepCopy,getDateString } from "@/assets/js/common.js";
import commonObject from "@/assets/js/xm.js";
let Controller = {
	created() {
		// this.init();
	},
	mounted() {
		
	},
	methods: {
		init() {
			this.getList(this);
		},
		//获取列表
		getList(barcode) {
			var apiTest = this.apiTest;
			this.$ajax({
					method: 'get',
					url:`${apiTest}/sale/saleGoodsInfo/getInfoByBarcode?barcode=${barcode}`
			    }).then((res)=>{
					// this.Model.tableData = [];
					let data = res.data
					if((data.status==200||data.status==0)&&data.result){
						
						let result = data.result
						console.log(result)
						this.Model.tableData.push(result)
					}
				});
		},
		handleSelectionChange(val){
			console.log(val)
		},
		toSearch(val) {
			this.getList(val.find(item=>item.key=='barcode').value);
		},
		toClear(val) {
			this.Model.searchFromData = {};
		},
		toExport(val) {
		  console.log(val);
		},
		tips(that,type,message) {
			that.$message({
				message: message,
				type: type
			});
		},
	},
	watch:{
		$route:{
		　　　handler(newValue, oldValue) {
				
		　　　},
		　　　deep: true
		},
  	
	},
	filters:{
		objFilters:function(value){
			
		}
	}
}
export default Controller;
